package com.apes.auto.car.service;

import com.apes.auto.car.model.AutoLevel;
import com.apes.auto.car.repository.AutoLevelRepository;
import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName AutoLevelService
 * @Description TODO
 * @Author pengyb
 * @Date 2019/7/12 11:29
 * @Version 1.0
 **/
@Service("autoLevelService")
public class AutoLevelService extends DomainService {
    @Autowired
    private AutoLevelRepository autoLevelRepository;

    public AutoLevel save(SimpleRequest request) {
        AutoLevel o = request.getO(AutoLevel.class);
        return autoLevelRepository.save(o);

    }

    public String delete(SimpleRequest request) {
        AutoLevel o = request.getO(AutoLevel.class);
        autoLevelRepository.delete(o.getId());
        return "删除成功";
    }
}
